﻿@model Lucy.Models.Customer

@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<fieldset>
    <legend>Customer</legend>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.UserName)
    </div>
    <div class="display-field">
        <b>@Html.DisplayFor(model => model.UserName)</b>
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.Email)
    </div>
    <div class="display-field">
        <b>@Html.DisplayFor(model => model.Email)</b>
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.FirstName)
    </div>
    <div class="display-field">
        <b>@Html.DisplayFor(model => model.FirstName)</b>
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.LastName)
    </div>
    <div class="display-field">
        <b>@Html.DisplayFor(model => model.LastName)</b>
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.Address)
    </div>
    <div class="display-field">
        <b>@Html.DisplayFor(model => model.Address)</b>
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.Phone)
    </div>
    <div class="display-field">
        <b>@Html.DisplayFor(model => model.Phone)</b>
    </div>
    <div>
        <table style="width:100%;">
            <tr>
                <th>
                    Order ID
                </th>
                <th>
                    Date
                </th>
                <th>
                    Total Price
                </th>
                <th>
                    Status
                </th>
                <th>
                    Details
                </th>
                <th></th>
            </tr>

            @foreach (var item in Model.Orders)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.OrderID)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Date)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.TotalPrice)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Status)
                    </td>
                    <td>
                        @Html.ActionLink("Details", "Details", "Order", htmlAttributes: new { id = item.OrderID })
                    </td>
                </tr>
            }
            </table>
    </div>

   
    
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.CustomerID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
